package eteam.aps.systeminterface.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import javax.validation.GroupSequence;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@ApiModel(value = "机构信息")
@GroupSequence({Insert.class, Update.class, OrgDto.class})
public class OrgDto implements Serializable {
    @ApiModelProperty("机构ID")
    @NotBlank(message = "机构ID为空", groups = Update.class)
    public String forgid;
    @ApiModelProperty("机构编号")
    @NotBlank(message = "机构编号为空", groups = {Insert.class, Update.class})
    public String fcode;
    /**
     * 内部编号，用于查询使用，每层机构/部门ID拼接
     */
    //public String finsidecode;
    @ApiModelProperty("机构名称")
    @NotBlank(message = "机构名称为空", groups = {Insert.class, Update.class})
    public String fname;
    @ApiModelProperty("上级机构ID")
    @NotBlank(message = "上级机构ID为空", groups = {Insert.class, Update.class})
    public String faboveid;
    @ApiModelProperty("部门所属机构ID")
    public String fmentorgid;
    //@ApiModelProperty("部门/机构 0: 机构 1: 部门")
    //public Integer fisdept;
    @ApiModelProperty("类别：0总部，10基地/师，20旅/团，30技保队/修理队，40连队")
    @NotNull(message = "类别不合法", groups = {Insert.class, Update.class})
    @Max(value = 40, message = "类别不合法", groups = {Insert.class, Update.class})
    @Min(value = 0, message = "类别不合法", groups = {Insert.class, Update.class})
    public Integer funittypeid;
    @ApiModelProperty("负责人")
    //@NotBlank(message = "负责人为空", groups = {Insert.class, Update.class})
    public String fmanager;
    @ApiModelProperty("负责人ID")
    //@NotBlank(message = "负责人ID为空", groups = {Insert.class, Update.class})
    public String fmanagerid;
    @ApiModelProperty("电话")
    //@NotBlank(message = "电话为空", groups = {Insert.class, Update.class})
    public String ftel;
    @ApiModelProperty("排序")
    public Integer forder = 0;
    @ApiModelProperty("备注")
    public String fremark;

    //public String frecorder;
    // public String frecordername;
    // public Date frecordtime;
    // public String flastmodifier;
    // public String flastmodifiername;
    // public Date flastmodifytime;

    @ApiModelProperty("状态【-1删除 0停用 1启用】")
    @NotNull(message = "状态不合法", groups = {Insert.class, Update.class})
    @Max(value = 1, message = "状态不合法", groups = {Insert.class, Update.class})
    @Min(value = -1, message = "状态不合法", groups = {Insert.class, Update.class})
    public Integer state;
}
